USE [NGroup_VTL_DB]
GO

/****** Object:  StoredProcedure [dbo].[DeleteGenericType]    Script Date: 01/16/2014 23:36:26 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DeleteGenericType]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[DeleteGenericType]
GO

USE [NGroup_VTL_DB]
GO

/****** Object:  StoredProcedure [dbo].[DeleteGenericType]    Script Date: 01/16/2014 23:36:26 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


-- =============================================
-- Author:		Nguyen Vu Nam
-- Create date: 20131218
-- Description:	Update GenericTypes
-- =============================================
CREATE PROCEDURE [dbo].[DeleteGenericType]
	@ID				int,
	@IsActive		bit,	
	@LastUpdatedAt	datetime,
	@LastUpdatedBy	nvarchar(50),
	@Rowcount		INT = -1 OUTPUT

AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	UPDATE [NGroup_VTL_DB].[dbo].[GenericTypes]
	   SET 
		  [IsActive] = @IsActive
		  ,[LastUpdatedAt] = @LastUpdatedAt
		  ,[LastUpdatedBy] = @LastUpdatedBy
	 WHERE [ID] = @ID;
	 UPDATE [NGroup_VTL_DB].[dbo].[GenericTypes]
	   SET 
		  [IsActive] = @IsActive
		  ,[LastUpdatedAt] = @LastUpdatedAt
		  ,[LastUpdatedBy] = @LastUpdatedBy
	 WHERE [SupTypeID] = @ID
	 SELECT @Rowcount = @@ROWCOUNT
END









GO

